//
//  MonsterDen.hpp
//  fingeradvanture
//
//  Created by shuaibincheng on 16/5/1.
//
//

#ifndef MonsterDen_hpp
#define MonsterDen_hpp

#include "cocos2d.h"
#include "GameHero.hpp"
#include "Box2D/Box2D.h"

USING_NS_CC;

enum MonsterType
{
    MONSTER_UNKNOWN,
    MONSTER_1,
    MONSTER_2,
    MONSTER_3,
    MONSTER_4,
    MONSTER_5,
    MONSTER_6,
    MONSTER_5_1,
    MONSTER_5_2,
    MONSTER_2_1,
    MONSTER_2_2,
    MONSTER_4_1,
    MONSTER_4_2,
    MONSTER_4_3,
    SPIKES_1,
    SPIKES_2,
    SPIKES_3,
    SPIKES_4
};

//提供一些关于monster的信息，目前只需要monster的type信息
class MonsterUserData
{
private:
    MonsterType type;
public:
    inline void setType(MonsterType type){ this->type = type; }
    inline MonsterType getType(){ return this->type; }
    
};

class MonsterDen
{
private:
    bool foundHero;
private:
    Vector<Node *> *waitingMonsters; //等征出征的monster
    Vector<Node *> *fightingMonster; //已经出征的monster
protected:
    
    
public:
    MonsterDen();
    ~MonsterDen();
    
    void notifyHeroEntered();
    void notifyHeroExited();

    void recycleUselessTroops(b2World* world); //回收已经出征的怪物组
    Vector<Node *> decideToSendTroops(b2World* world);     //判断是否要派出怪物组
    Node *callOfDuty(b2World *world, MonsterType type); //征召一个特定种类的怪物
    
    static MonsterDen *getInstance();
protected:
    static MonsterDen *den;
};
#endif /* MonsterDen_hpp */
